﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Windows8Accelerator.Core.Xaml.Controls
{
    public class SuperTextFormat
    {
        public SuperTextFormat Clone()
        {
            return new SuperTextFormat()
            {
                FontWeight = this.FontWeight,
                FontStyle = this.FontStyle,
                FontSize = this.FontSize,
                FontFamilyName = this.FontFamilyName,
                ForegroundColor = this.ForegroundColor,
            };
        }

        public SuperFontWeight? FontWeight { get; set; }
        public SuperFontStyle? FontStyle { get; set; }
        public string FontFamilyName { get; set; }
        public double? FontSize { get; set; }
        public string ForegroundColor { get; set; }

        public void Merge(SuperTextFormat superTextFormat)
        {
            if (superTextFormat.FontStyle != null)
                this.FontStyle = superTextFormat.FontStyle;
            if (superTextFormat.FontWeight != null)
                this.FontWeight = superTextFormat.FontWeight;
            if (superTextFormat.FontSize != null)
                this.FontSize = superTextFormat.FontSize;
            if (superTextFormat.ForegroundColor != null)
                this.ForegroundColor = superTextFormat.ForegroundColor;
            if (superTextFormat.FontFamilyName != null)
                this.FontFamilyName = superTextFormat.FontFamilyName;
        }
    }

}
